package server;

import java.util.HashMap;
import java.util.Map;

public class Host {

    private String name;

    private String appBase;

    private final Map<String, Context> contexts = new HashMap<>();

    public Host(String name, String appBase) {
        this.name = name;
        this.appBase = appBase;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAppBase() {
        return appBase;
    }

    public void setAppBase(String appBase) {
        this.appBase = appBase;
    }

    public void addContext(String name, Context context) {
        this.contexts.putIfAbsent(name, context);
    }

    public Context getContext(String name) {
        return contexts.get(name);
    }

    public void rmCOntext(String name) {
        this.contexts.remove(name);
    }
}
